home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 7.1 KB | 270 lines |
- '***************************
- '* AMOS Professional * INSTRUCTIONS COVERED
- '* *
- '* RAINBOWS * Set Rainbow (line 25)
- '* * Rainbow (line 64)
- '* (c) Europress Software * Rain (line 85)
- '* * Rainbow Del (line 101)
- '* Ronnie Simpson *
- '***************************
- '
- '-------------------------------------------
- 'GENERAL
- '-------------------------------------------
- 'Rainbows allow each scan line of the screen to be any one of the 4096
- 'available colours and works equally well in all screen modes including
- '2 colour.
- 'A maximum of 4 rainbows can be defined at any one time.
- 'Do not use rainbows on a colour which is currently being animated with
- 'the Flash command.
- 'Only a single rainbow can affect a single scan line, if 2 rainbows overlap
- 'then the one with the highest screen position will be given priority and if
- '2 rainbows start at the same position then the one with the lowest
- 'identification number will be viewed.
- '-------------------------------------------
- 'Set Rainbow
- '-------------------------------------------
- 'set a rainbow definition
- '
- '
- ' +---->Rainbow identification number
- ' | +---->Colour index number to be affected
- ' | | +---->Size of table required
- ' | | | +---->Red components
- ' | | | | +----> Blue components
- ' | | | /|\ /|\ +---->Green components
- ' | | | / | \ / | \ /|\
- ' Set Rainbow 1,0,32,"(1,1,15)","(1,-1,15)","(1,2,15)"
- '
- 'Identification number - maximum of four rainbows (range 0-3)
- ' Colour index number - only colours 0-15 can be altered by the rainbows
- ' Size of table - 1 entry for each colour value on screen (16-65500)
- '
- 'Colour components "(1,1,15)"
- ' | | |
- ' | | +---->Number of times operation is to be repeated
- ' | +---->Number to be added to each colour change
- ' +---->Number of scan lines for each colour change
- '-------------------------------------------
- 'EXAMPLE OF SET RAINBOW
- '-------------------------------------------
- ' Set Rainbow 2,4,16,"","(3,-1,15)",""
- '
- 'Set rainbow number 2 to affect colour index number 4, the size of table
- 'is 16 to cover the number of different colours.
- 'Ignore the red component and change the green component by subtracting
- '-1 from the step count and affecting 3 scan lines at each step and repeat
- 'this operation 15 times.
- 'Ignore the blue components.
- '
- 'When the colour component reaches the maximum of 15 (or 0 if step size is
- 'negative) then a new value is calculated by:- new=old Mod 15
- '
- '-------------------------------------------
- 'Rainbow
- '-------------------------------------------
- 'display rainbow on the screen
- '
- 'The Set Rainbow instruction only defines the rainbow in order to display
- 'it the Rainbow command is used.
- '
- ' +---->identification number of the rainbow to be displayed
- ' | +---->offset value of the first colour
- ' | | +---->vertical position on screen
- ' | | | +---->height in scan lines
- ' | | | |
- ' Rainbow 1,0,50,200
- '
- 'Changing the offset value will roll the rainbow colours on screen.
- 'Changing the vertical position will cause the rainbow to scroll up and
- 'down the screen.
- 'The minimum value for the vertical position is 40 and anything below this
- 'will only be shown from scan line 40.
- '
- '-------------------------------------------
- 'Rain
- '-------------------------------------------
- 'change colour of 1 scan line
- '
- 'In order to use this powerful instruction a rainbow with dummy values
- 'must first be set up.
- ' eg. Set Rainbow 1,1,255,"","",""
- ' Rainbow 1,1,40,200
- '
- ' +---->rainbow identification number
- ' | +---->the scan line number to be affected
- ' | | +---->the colour value to be assigned
- ' | | |
- ' Rain (1,100)=2038
- '
- '-------------------------------------------
- 'Rainbow Del
- '-------------------------------------------
- 'Delete 1 or all of the rainbows
- '
- 'eg Rainbow Del 3 (delete rainbow number 3)
- '
- 'If used without parameters then all rainbows will be deleted.
- '
- '-------------------------------------------
- 'WORKING EXAMPLES
- '-------------------------------------------
- Dim C$(9)
- '
- Rem *** Tidy up the screen and print title
- '
- Curs Off : Flash Off : Cls 3 : Hide
- Palette $0,$F00,$F0,$F,$F0,$F0F,$FF
- Pen 6 : Paper 3 : Double Buffer
- Centre "AMOS Professional RAINBOWS"
- Wait 30
- Fade 5,,,,0 : Wait 75
- '
- '
- Rem set 3 coloured bars
- '
- Set Rainbow 0,3,60,"","","(2,1,15)(2,-1,15)"
- Set Rainbow 1,3,60,"","(2,1,15)(2,-1,15)",""
- Set Rainbow 2,3,60,"(2,1,15)(2,-1,15)","",""
- Rainbow 0,0,60,60
- Rainbow 1,0,122,60
- Rainbow 2,0,184,60
- Wait 100
- '
- '
- Rem *** rolling bars
- '
- For N=0 To 2
- For T=1 To 3
- For Y=0 To 59
- Rainbow N,Y,,
- Wait Vbl
- Next
- Next
- Next
- For T=1 To 3
- For Y=59 To 0 Step -1
- Rainbow 0,Y,,
- Rainbow 1,Y,,
- Rainbow 2,Y,,
- Wait Vbl
- Next
- Next
- Wait 20
- '
- '
- Rem *** scrolling bars
- '
- For Y=60 To 122
- Rainbow 0,,Y,
- Wait Vbl
- Next
- Wait 20
- For Y=122 To 184
- Rainbow 1,,Y,
- Wait Vbl
- Next
- Wait 20
- For Y=184 To 60 Step -1
- Rainbow 2,,Y,
- Wait Vbl
- Next
- Wait 20
- '
- '
- Rem *** a screen-sized multi-coloured rainbow
- '
- Rainbow Del 1
- Rainbow Del 2
- For H=1 To 200
- Set Rainbow 0,3,200,"(1,-1,15)","(2,1,15)","(3,1,15)"
- Rainbow 0,0,50,H
- Next
- Wait 30
- '
- '
- Rem *** 3 changing /scrolling / multi-coloured bars
- '
- C$(1)="(2,1,15)(2,-1,15)"
- C$(2)="(1,1,15)(1,-1,15)"
- C$(3)="(1,2,15)(1,-2,15)"
- C$(4)="(1,3,15)(1,-3,15)"
- C$(5)="(5,1,15)(5,-1,15)"
- C$(6)="(1,1,6)(1,-1,6)"
- C$(7)="(3,3,5)(3,-3,5)"
- C$(8)=""
- C$(9)=""
- Locate 0,22 : Centre "MULTI-COLOURED"
- For N=1 To 10
- Set Rainbow 0,3,60,C$(Rnd(8)+1),C$(Rnd(8)+1),C$(Rnd(8)+1)
- Set Rainbow 1,3,60,C$(Rnd(8)+1),C$(Rnd(8)+1),C$(Rnd(8)+1)
- Set Rainbow 2,3,60,C$(Rnd(8)+1),C$(Rnd(8)+1),C$(Rnd(8)+1)
- For Y=254 To 50 Step -1
- Rainbow 0,3,Y,60
- Rainbow 1,3,Y+62,60
- Rainbow 2,3,Y+124,60
- For DELAY=1 To 80 : Next
- Next
- Wait 20
- For Y=50 To 254
- Rainbow 0,,Y,
- Rainbow 1,3,Y+62,60
- Rainbow 2,3,Y+124,60
- For DELAY=1 To 20 : Next
- Next
- Wait 20
- Next
- Wait 20
- '
- '
- Rem *** show all 4096 colours
- '
- D=1 : Y=0
- Locate 0,22 : Centre "ALL THE COLOURS OF THE RAINBOW"
- Rainbow Del
- Wait 50
- Set Rainbow 0,3,160,"","",""
- For P=0 To 4096
- Add Y,D
- If Y=1 Then D=1
- If Y=159 Then D=-1
- Rain(0,Y)=P
- Rainbow 0,0,60,160
- For DELAY=1 To 4 : Next
- Next
- '
- '
- Rem *** a neat disappearing trick
- '
- For Y=1 To 79
- Rain(0,Y)=0
- Rain(0,160-Y)=0
- Rainbow 0,0,60,170
- Wait Vbl
- Next
- Wait 50
- '
- '
- Rem *** rainbows with patterns
- '
- Cls 0
- Set Rainbow 0,3,60,"","","(1,1,15)(1,-1,15)"
- Set Rainbow 1,3,60,"","(1,1,15)(1,-1,15)",""
- Set Rainbow 2,3,60,"(1,1,15)(1,-1,15)","",""
- Rainbow 0,0,60,60
- Rainbow 1,0,122,60
- Rainbow 2,0,184,60
- For N=1 To 15
- Ink 3,0
- Set Pattern N+4
- Bar 0,0 To 319,199
- Wait 30
- Ink 0,3
- Set Pattern N+19
- Bar 80,50 To 240,150
- Wait 30
- Next
- Wait 50
- '
- '
- Edit